﻿# CMakeList.txt: tokenizer 的 CMake 项目，在此处包括源代码并定义
# 项目特定的逻辑。
#
project(grammar LANGUAGES CXX)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIRECTORY}/Library)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_DIRECTORY}/Library)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIRECTORY}/Runtime)

include_directories(${SOLUTION_DIR}/tokenizer)

set(PROJECT_HEADERS
  grammar_global.h
  Ast.h
  Combination.h
  Grammar.h
  Parser.h
)

set(PROJECT_SOURCES
  Ast.cpp
  Combination.cpp
  Grammar.cpp
  Parser.cpp
)

add_library (${PROJECT_NAME} SHARED  ${PROJECT_HEADERS} ${PROJECT_SOURCES})

link_directories(${SOLUTION_DIR}/Library)

target_link_libraries(${PROJECT_NAME} PRIVATE tokenizer)

if (CMAKE_VERSION VERSION_GREATER 3.12)
  set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 20)
endif()

target_compile_definitions(${PROJECT_NAME} PRIVATE GRAMMAR_LIBRARY)

# TODO: 如有需要，请添加测试并安装目标。
